<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html>
   <head>
	   <script>
		  function processURL() {
		    var chosenvalue = trimSpaces(getComboSelected('wordfamily'));
		    if(chosenvalue.length != 0) {
				url = '/lwf/rhymingwords.do?action=display&wordfamily=' + chosenvalue;
		    	retrieveURL(url, 'displayblock');
		    }
		  }
      </script>
   </head>
   <html:form action="/rhymingwords" >
   <table border="0" align="center" width="75%" bordercolor="red"> 
       <tr>
           <td align="center">
               <bean:define id="rhymingwords" name="rwform" property="rhymingwords" type="java.util.List" />
               <fieldset><legend style="font-size:12px;"><b>Select a word family</b></legend>
                  <html:select property="wordfamily" style="font-size:20px;" onchange="processURL()">
                      <html:options property="rhymingwords"/>
                  </html:select>
               </fieldset>
           </td>
       </tr>         
       <tr>
           <td>
               <table border="0" width="100%">
                  <tr>
                      <td align="center">
                         <span align="center" id="displayblock"></span>
                      </td>
                  </tr>                  
               </table>
           </td>
       </tr> 
   </table>  
   </html:form>

</html>